package com.znf4.controller.sett;
/*package com.znf4.platform.controller.sett;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.znf4.platform.account.dao.RpSettRecordDao;
import com.znf4.platform.account.entity.RpAccount;
import com.znf4.platform.account.entity.RpRemitApplication;
import com.znf4.platform.account.entity.RpSettRecord;
import com.znf4.platform.account.enums.SettModeTypeEnum;
import com.znf4.platform.account.enums.SettRecordStatusEnum;
import com.znf4.platform.account.exception.SettBizException;
import com.znf4.platform.account.service.RpAccountService;
import com.znf4.platform.account.service.RpRemitApplicationService;
import com.znf4.platform.account.service.RpSettHandleService;
import com.znf4.platform.account.service.RpSettQueryService;
import com.znf4.platform.bank.enums.BankSettTypeEnum;
import com.znf4.platform.common.core.dwz.DWZ;
import com.znf4.platform.common.core.dwz.DwzAjax;
import com.znf4.platform.common.core.entity.ApiCommonResultVo;
import com.znf4.platform.common.core.enums.PayTypeEnum;
import com.znf4.platform.common.core.enums.PayWayEnum;
import com.znf4.platform.common.core.enums.PublicEnum;
import com.znf4.platform.common.core.enums.UserTypeEnum;
import com.znf4.platform.common.core.exception.BizException;
import com.znf4.platform.common.core.page.PageBean;
import com.znf4.platform.common.core.page.PageParam;
import com.znf4.platform.common.core.utils.StringUtil;
import com.znf4.platform.trade.service.RpTradePaymentManagerService;
import com.znf4.platform.user.entity.RpUserBankAccount;
import com.znf4.platform.user.entity.RpUserInfo;
import com.znf4.platform.user.entity.RpUserPayConfig;
import com.znf4.platform.user.enums.BankAccountTypeEnum;
import com.znf4.platform.user.enums.BankCodeEnum;
import com.znf4.platform.user.enums.CardTypeEnum;
import com.znf4.platform.user.exception.UserBizException;
import com.znf4.platform.user.service.RpUserBankAccountService;
import com.znf4.platform.user.service.RpUserInfoService;
import com.znf4.platform.user.service.RpUserPayConfigService;

*//**
 * 结算管理
 *//*
@Controller
@RequestMapping("/sett")
public class SettController {
	
	private static final Log LOG = LogFactory.getLog(SettController.class);
	@Autowired
	private RpSettQueryService rpSettQueryService;
	@Autowired
	private RpSettHandleService rpSettHandleService;
	@Autowired
	private RpAccountService rpAccountService;
	@Autowired
	private RpUserBankAccountService rpUserBankAccountService;
	@Autowired
	private RpUserInfoService rpUserInfoService;
	@Autowired
	private RpTradePaymentManagerService rpTradePaymentManagerService;
	@Autowired
	private RpSettRecordDao rpSettRecordDao;
	@Autowired
	private RpUserPayConfigService rpUserPayConfigService;
	@Autowired
	private RpRemitApplicationService rpRemitApplicationService;
	*//**
	 * 函数功能说明 ： 查询分页数据
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequestMapping(value = "/list", method = { RequestMethod.POST, RequestMethod.GET })
	public String list(RpSettRecord rpSettRecord, PageParam pageParam, Model model) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("userName", rpSettRecord.getUserName());// 用户名称
		paramMap.put("userNo", rpSettRecord.getUserNo());// 用户编号
		paramMap.put("bankAccountName", rpSettRecord.getBankAccountName());// 收款人名称
		paramMap.put("bankAccountNo", rpSettRecord.getBankAccountNo());// 收款人账号
		paramMap.put("remitRequestNo", rpSettRecord.getRemitRequestNo());// 银行打款请求号
		paramMap.put("merchantRequestNo", rpSettRecord.getMerchantRequestNo());// 商户请求号
		paramMap.put("settStatus", rpSettRecord.getSettStatus());// 商户请求号
		paramMap.put("isCount", 1); // 是否统计当前条件下的数据
		PageBean pageBean = rpSettQueryService.querySettRecordListPage(pageParam, paramMap);
		Map<String, Object> countResultMap = pageBean.getCountResultMap();
		System.out.println(countResultMap.get("sumSettFee"));
		BigDecimal sumSettFee = (BigDecimal) countResultMap.get("sumSettFee") == null ? BigDecimal.ZERO : (BigDecimal) countResultMap.get("sumSettFee");
		BigDecimal sumPlatCost = (BigDecimal) countResultMap.get("sumPlatCost") == null ? BigDecimal.ZERO : (BigDecimal) countResultMap.get("sumPlatCost");
		countResultMap.put("sumPlatProfit", sumSettFee.subtract(sumPlatCost).toString());
		model.addAttribute("pageBean", pageBean);
		model.addAttribute("countResultMap", countResultMap);
		model.addAttribute("pageParam", pageParam);
		model.addAttribute("rpSettRecord", rpSettRecord);
		model.addAttribute("settStatusEnum", SettRecordStatusEnum.toMap());// 商户请求号
		return "sett/list";
	}

	*//**
	 * 函数功能说明 ：跳转发起结算
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:record:add")
	@RequestMapping(value = "/launchSettUI", method = RequestMethod.GET)
	public String launchSettUI() {

		return "sett/add";
	}

	*//**
	 * 函数功能说明 ： 发起结算
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:record:add")
	@RequestMapping(value = "/launchSett", method = RequestMethod.POST)
	public String launchSett(HttpServletRequest request, Model model, DwzAjax dwz) {
		String userNo = request.getParameter("user.userNo");
		String applyAmount = request.getParameter("applyAmount");
		RpUserInfo rpUserInfo = rpUserInfoService.getDataByMerchentNo(userNo);
		if(!(rpUserInfo.getUserType().equals(UserTypeEnum.AGENT.name())||
				rpUserInfo.getUserType().equals(UserTypeEnum.NOT_DIRECT_AGENT.name()))){
			dwz.setStatusCode(DWZ.ERROR);
			dwz.setMessage("该用户非代理商角色不能进行线下打款!");
			model.addAttribute("dwz", dwz);
			return DWZ.AJAX_DONE;
		}
		rpSettHandleService.launchSett(userNo, new BigDecimal(applyAmount));
		dwz.setStatusCode(DWZ.SUCCESS);
		dwz.setMessage(DWZ.SUCCESS_MSG);
		model.addAttribute("dwz", dwz);
		return DWZ.AJAX_DONE;
	}

	*//**
	 * 函数功能说明 ：跳转审核
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:record:edit")
	@RequestMapping(value = "/auditUI", method = RequestMethod.GET)
	public String auditUI(Model model, @RequestParam("id") String id) {
		RpSettRecord settRecord = rpSettQueryService.getDataById(id);
		model.addAttribute("settRecord", settRecord);
		return "sett/audit";
	}

	*//**
	 * 函数功能说明 ： 审核
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:record:edit")
	@RequestMapping(value = "/audit", method = RequestMethod.POST)
	public String audit(HttpServletRequest request, Model model, DwzAjax dwz) {
		String settId = request.getParameter("settId");
		String settStatus = request.getParameter("settStatus");
		String remark = request.getParameter("remark");
		rpSettHandleService.audit(settId, settStatus, remark);
		dwz.setStatusCode(DWZ.SUCCESS);
		dwz.setMessage(DWZ.SUCCESS_MSG);
		model.addAttribute("dwz", dwz);
		return DWZ.AJAX_DONE;
	}

	*//**
	 * 函数功能说明 ： 发起打款
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:record:edit")
	@RequestMapping(value = "/remit", method = RequestMethod.POST)
	public String remit(HttpServletRequest request, Model model, DwzAjax dwz) {
		String settId = request.getParameter("id");
		// String settStatus = request.getParameter("settStatus");
		// String remark = request.getParameter("remark");
		rpSettHandleService.remit(settId, null, null);

		// 发起代付
		RpSettRecord settRecord = rpSettQueryService.getDataById(settId);
		if(settRecord.getSettMode().equals(SettModeTypeEnum.REGULAR_SETTLE.name())){
			rpTradePaymentManagerService.proxyPayForT1(settRecord.getRemitAmount(), settRecord.getRemitRequestNo(), settRecord.getProxyChannelCode(), settRecord.getUserNo(), settRecord.getBankAccountNo());
		}
		dwz.setStatusCode(DWZ.SUCCESS);
		dwz.setMessage(DWZ.SUCCESS_MSG);
		model.addAttribute("dwz", dwz);
		return DWZ.AJAX_DONE;
	}

	*//**
	 * 函数功能说明 ： 发起打款
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:record:callBackRemit")
	@RequestMapping(value = "/callBankRemit")
	public String callBankRemit(HttpServletRequest request, Model model, DwzAjax dwz) {
		String settId = request.getParameter("id");

		rpSettHandleService.callBankRemit(settId);

		dwz.setStatusCode(DWZ.SUCCESS);
		dwz.setMessage(DWZ.SUCCESS_MSG);
		model.addAttribute("dwz", dwz);
		return DWZ.AJAX_DONE;
	}
	
	*//**
	 * 函数功能说明 ：平台手动打款
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:record:callBackRemit")
	@RequestMapping(value = "/remitAddUI")
	public String lineProxyPayPage(HttpServletRequest request, Model model, DwzAjax dwz) {
		try {
			String settRecordId = request.getParameter("id"); //获取需要手动结算的id
			
			if(StringUtil.isEmpty(settRecordId)){
				LOG.info("结算记录不存在" + settRecordId);
				throw SettBizException.SETT_RECORD_IS_NULL;
			}
			
			//根据结算ID获取结算信息
			RpSettRecord rpSettRecord = rpSettRecordDao.getById(settRecordId);
			if (rpSettRecord == null){
				LOG.info("结算记录不存在" + settRecordId);
				throw SettBizException.SETT_RECORD_IS_NULL;
			}

			RpUserInfo rpUserInfo = rpUserInfoService.getDataByMerchentNo(rpSettRecord.getUserNo());
			if (rpUserInfo == null){
				LOG.info("该笔结算记录对应的商户不存在或者状态异常");
				throw new UserBizException(UserBizException.USER_STATUS_ERROR ,"该笔结算记录对应的商户不存在或者状态异常");
			}
			
			RpUserPayConfig rpUserPayConfig = rpUserPayConfigService.getByUserNo(rpUserInfo.getUserNo(),PublicEnum.YES.name());
			if (rpUserPayConfig == null){
				LOG.info("该笔结算记录对应的商户支付配置或者状态异常");
				throw new UserBizException(UserBizException.USER_STATUS_ERROR ,"该笔结算记录对应的商户支付配置在或者状态异常");
			}
			
			PayTypeEnum payTypeEnum = PayTypeEnum.getEnum(rpSettRecord.getPayTypeCode());
			
			model.addAttribute("rpSettRecord", rpSettRecord);
			model.addAttribute("rpUserPayConfig", rpUserPayConfig);
			
			model.addAttribute("payWay", payTypeEnum.getPayWay());
			model.addAttribute("bankSettTypeList", BankSettTypeEnum.toList()); //
			model.addAttribute("bankCodeEnumList", BankCodeEnum.toList()); //
			model.addAttribute("payWayEnumList", PayWayEnum.toList()); 
			model.addAttribute("bankAccountTypeEnumList", BankAccountTypeEnum.toList()); //
			
		} catch (BizException e) {
			dwz.setStatusCode(DWZ.ERROR);
			dwz.setMessage(e.getMsg());
			model.addAttribute("dwz", dwz);
			return DWZ.AJAX_DONE;
		} catch (Exception e) {
			dwz.setStatusCode(DWZ.ERROR);
			dwz.setMessage("系统异常");
			model.addAttribute("dwz", dwz);
			return DWZ.AJAX_DONE;
		}
		
		return "sett/remitAdd";
		
	}
	
	*//**
	 * 确认发起结算
	 * @return
	 *//*
	@RequiresPermissions("sett:record:callBackRemit")
	@RequestMapping(value = "/confirmRemit")
	public String confirmRemit(HttpServletResponse response, HttpServletRequest request, DwzAjax dwz, Model model){
		
		try{
			//获取前台参数
			String bankAccountNo = request.getParameter("bankAccountNo");
			String bankAccountName = request.getParameter("bankAccountName");
			String bankAccountType = request.getParameter("bankAccountType");
			String settAmount = request.getParameter("settAmount");
			String phoneNo = request.getParameter("phoneNo");
			String bankCode = request.getParameter("bankCode");
			String cardNo = request.getParameter("cardNo");
			String proxyType = request.getParameter("proxyType");
			String productType = request.getParameter("productType");
			
			//TODO 非空校验
			String settRecordId = request.getParameter("id"); //旧的结算id
			//根据结算ID获取结算信息
			RpSettRecord rpSettRecord = rpSettRecordDao.getById(settRecordId);
			
			if (rpSettRecord == null){
				LOG.info("结算记录不存在" + settRecordId);
				throw SettBizException.SETT_RECORD_IS_NULL;
			}
	
			RpUserInfo rpUserInfo = rpUserInfoService.getDataByMerchentNo(rpSettRecord.getUserNo());
			if (rpUserInfo == null){
				LOG.info("该笔结算记录对应的商户不存在或者状态异常");
				throw new UserBizException(UserBizException.USER_STATUS_ERROR ,"该笔结算记录对应的商户不存在或者状态异常");
			}
			
			//准备结算信息
			RpRemitApplication remit = new RpRemitApplication();
			remit.setId(StringUtil.get32UUID());
			RpUserPayConfig rpUserPayConfig = rpUserPayConfigService.getByUserNo(rpUserInfo.getUserNo());
			remit.setPayKey(rpUserPayConfig.getPayKey());//获取支付key
			String remitRequestNo = rpAccountService.buildRemitRequestNo();//获取请求号
			remit.setOutTradeNo(remitRequestNo);
			remit.setBankAccountNo(bankAccountNo);//银行卡号
			remit.setBankAccountName(bankAccountName);//银行账户名
			remit.setBankAccountType(bankAccountType);//银行卡类型
			remit.setSettAmount(new BigDecimal(settAmount));//代付金额
			remit.setPhoneNo(phoneNo);//手机号
			remit.setBankCode(bankCode);
			BankCodeEnum codeEnum = BankCodeEnum.getEnum(bankCode);
			if(null == codeEnum){
				remit.setBankName(bankCode);//银行名
			}else{
				remit.setBankName(codeEnum.getDesc());//银行名
			}
			remit.setBankBranchNo("123456789");//联行号
			remit.setBankClearNo("123456789");
			remit.setBankBranchName("zhmc");//支行名称		
			remit.setProxyType(proxyType);//交易类型
			remit.setProductType(productType);//产品类型
			remit.setProvince("xxx省");//开户行所在省
			remit.setCity("xxx市");//开户行所在市
			remit.setCardType(CardTypeEnum.IDENTITY.name());//开户人证件
			remit.setCardNo(cardNo);//收款人手机号
			remit.setStatus(SettRecordStatusEnum.WAIT_CONFIRM.name());//状态
			remit.setEditTime(new Date());
			remit.setCreateTime(new Date());
			
			rpRemitApplicationService.saveRemitApplication(remit); //插入新的结算记录
			
			rpRemitApplicationService.remitApply(remit, remitRequestNo); //向上游发起结算打款
			
			dwz.setStatusCode(DWZ.SUCCESS);
			dwz.setMessage(DWZ.SUCCESS_MSG);
			model.addAttribute("dwz", dwz);
			return DWZ.AJAX_DONE;
		
		}catch (BizException e) { //业务异常
			dwz.setStatusCode(DWZ.ERROR);
			dwz.setMessage(e.getMsg());
			model.addAttribute("dwz", dwz);
			return DWZ.AJAX_DONE;
		}catch (Exception e) {
			dwz.setStatusCode(DWZ.ERROR);
			dwz.setMessage("操作失败");
			model.addAttribute("dwz", dwz);
			return DWZ.AJAX_DONE;
		}
		
		
	}

	*//**
	 * 函数功能说明 ：查看
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequestMapping(value = "/view", method = RequestMethod.GET)
	public String view(Model model, @RequestParam("id") String id) {
		RpSettRecord settRecord = rpSettQueryService.getDataById(id);
		model.addAttribute("settRecord", settRecord);
		return "sett/view";
	}

	*//**
	 * 函数功能说明 ：根据支付产品获取支付方式
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequestMapping(value = "/getSettAmount", method = RequestMethod.GET)
	@ResponseBody
	public RpAccount getSettAmount(@RequestParam("userNo") String userNo) {
		RpAccount rpAccount = rpAccountService.getDataByUserNo(userNo);
		return rpAccount;
	}

	*//**
	 * 函数功能说明 ： 查询结算银行分页数据
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequestMapping(value = "/userBankList", method = { RequestMethod.POST, RequestMethod.GET })
	public String userBankList(RpUserBankAccount rpUserBankAccount, PageParam pageParam, Model model) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("userNo", rpUserBankAccount.getUserNo());
		PageBean pageBean = rpUserBankAccountService.listPage(pageParam, paramMap);
		List<Object> recordList = pageBean.getRecordList();
		for (Object obj : recordList) {
			RpUserBankAccount bank = (RpUserBankAccount) obj;
			RpUserInfo userInfo = rpUserInfoService.getDataByMerchentNo(bank.getUserNo());
			bank.setUserName(userInfo.getUserName());
		}
		model.addAttribute("pageBean", pageBean);
		model.addAttribute("pageParam", pageParam);
		model.addAttribute("rpUserBankAccount", rpUserBankAccount);
		return "sett/userBankList";
	}

	*//**
	 * 函数功能说明 ：跳转添加银行卡信息
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:bank:add")
	@RequestMapping(value = "/userBankAddUI", method = RequestMethod.GET)
	public String userBankAddUI(Model model) {
		model.addAttribute("BankCodeEnums", BankCodeEnum.toList());
		model.addAttribute("BankAccountTypeEnums", BankAccountTypeEnum.toList());
		model.addAttribute("CardTypeEnums", CardTypeEnum.toList());
		return "sett/userBankAdd";
	}

	*//**
	 * 函数功能说明 ： 保存银行卡信息
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:bank:add")
	@RequestMapping(value = "/userBankAdd", method = RequestMethod.POST)
	public String userBankAdd(HttpServletRequest request, Model model, RpUserBankAccount rpUserBankAccount, DwzAjax dwz) {
		String userNo = request.getParameter("user.userNo");
		rpUserBankAccount.setUserNo(userNo);
		rpUserBankAccountService.createUserBankAccount(rpUserBankAccount);
		dwz.setStatusCode(DWZ.SUCCESS);
		dwz.setMessage(DWZ.SUCCESS_MSG);
		model.addAttribute("dwz", dwz);
		return DWZ.AJAX_DONE;
	}

	*//**
	 * 函数功能说明 ：跳转编辑银行卡信息
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:bank:edit")
	@RequestMapping(value = "/userBankEditUI", method = RequestMethod.GET)
	public String userBankEditUI(Model model, @RequestParam("userNo") String userNo) {
		RpUserBankAccount rpUserBankAccount = rpUserBankAccountService.getByUserNo(userNo);
		RpUserInfo rpUserInfo = rpUserInfoService.getDataByMerchentNo(userNo);
		model.addAttribute("BankCodeEnums", BankCodeEnum.toList());
		model.addAttribute("BankAccountTypeEnums", BankAccountTypeEnum.toList());
		model.addAttribute("CardTypeEnums", CardTypeEnum.toList());
		model.addAttribute("rpUserBankAccount", rpUserBankAccount);
		model.addAttribute("rpUserInfo", rpUserInfo);
		return "sett/userBankEdit";
	}

	*//**
	 * 函数功能说明 ： 更新银行卡信息
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:bank:edit")
	@RequestMapping(value = "/userBankEdit", method = RequestMethod.POST)
	public String userBankEdit(Model model, RpUserBankAccount rpUserBankAccount, DwzAjax dwz) {
		rpUserBankAccountService.updateUserBankAccount(rpUserBankAccount);
		dwz.setStatusCode(DWZ.SUCCESS);
		dwz.setMessage(DWZ.SUCCESS_MSG);
		model.addAttribute("dwz", dwz);
		return DWZ.AJAX_DONE;
	}

	*//**
	 * 函数功能说明 ： 销账
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:record:edit")
	@RequestMapping(value = "/confirm", method = { RequestMethod.POST, RequestMethod.GET })
	public String confirm(Model model, DwzAjax dwz, @RequestParam("id") String id) {
		rpSettHandleService.confirm(id);
		dwz.setStatusCode(DWZ.SUCCESS);
		dwz.setMessage(DWZ.SUCCESS_MSG);
		model.addAttribute("dwz", dwz);
		return DWZ.AJAX_DONE;
	}

	*//**
	 * 函数功能说明 ：跳转打款结果
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:record:edit")
	@RequestMapping(value = "/resultUI", method = { RequestMethod.POST, RequestMethod.GET })
	public String resultUI(Model model, @RequestParam("id") String id) {
		RpSettRecord settRecord = rpSettQueryService.getDataById(id);
		model.addAttribute("settRecord", settRecord);
		return "sett/result";
	}

	*//**
	 * 函数功能说明 ：打款结果
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 *//*
	@RequiresPermissions("sett:record:edit")
	@RequestMapping(value = "/result", method = { RequestMethod.POST, RequestMethod.GET })
	public String result(HttpServletRequest request, Model model, DwzAjax dwz, @RequestParam("id") String id) {
		String settStatus = request.getParameter("settStatus");
		String remark = request.getParameter("remark");
		RpSettRecord settRecord = rpSettQueryService.getDataById(id);
		SettRecordStatusEnum settRecordStatusEnum = SettRecordStatusEnum.getEnum(settStatus);
		RpUserInfo rpUserInfo = rpUserInfoService.getDataByMerchentNo(settRecord.getUserNo());
		if(rpUserInfo.getUserType().equals(UserTypeEnum.MERCHANT.name())||
				rpUserInfo.getUserType().equals(UserTypeEnum.NOT_DIRECT_MERCHANT.name())){
			rpTradePaymentManagerService.setProxyPayResult(settRecord.getRemitRequestNo(), settRecord.getProxyChannelCode(), settRecordStatusEnum, remark);
		}else{
			//代理商线下打款
			rpSettHandleService.settForPayResult(settRecord.getRemitRequestNo(), settRecordStatusEnum.name(), remark);
		}

		dwz.setStatusCode(DWZ.SUCCESS);
		dwz.setMessage(DWZ.SUCCESS_MSG);
		model.addAttribute("dwz", dwz);
		return DWZ.AJAX_DONE;
	}
}
*/